package com.msb.configconsumer.controller;

import com.alibaba.fastjson2.JSONObject;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author DreamAndLove
 * @date 2024/09/09 9:31
 * @description
 */
@RestController
@RefreshScope
public class ConfigController {
    @Value("${label}")
    private String label;

    @GetMapping("/config")
    public JSONObject getPerson() {
        JSONObject person = new JSONObject();
        person.put("label", label);
        return person;
    }
}
